/***********************************************************************************************************************
/*
/*    Settings.cpp 
/*
/**********************************************************************************************************************/

#include "stdafx.h"

//======================================================================================================================
// DEFINES
//======================================================================================================================

#define ENTRY(a,b,c) int ( (BYTE*)&DefaultSettings.a - (BYTE*)&DefaultSettings ),   \
					 b,																\
					 c	// DON'T ERASE THIS LINE


//======================================================================================================================
// DATA
//======================================================================================================================

static const cSettings DefaultSettings;
	             
cSettings::sEntry cSettings::aTable [] =
{
	ENTRY ( sSignature,								string,					L"sSignature"							),
	ENTRY ( Version,								version,				L"Version"								),
	ENTRY ( bOn,								    boolean,				L"bOn"								    ),
	ENTRY ( uBrightness,							uint,				    L"uBrightness"		                    ),
	ENTRY ( uContrast,							    uint,				    L"uContrast"		                    ),
	ENTRY ( uGamma,							        uint,				    L"uGamma"		                        ),
	ENTRY ( bExpanded,								boolean,				L"bExpanded"						    ),
	ENTRY ( ptMainWindowPosition,                   point_i,                L"ptMainWindowPosition"                 ),
};


//======================================================================================================================
// CODE
//======================================================================================================================

//----------------------------------------------------------------------------------------------------------------------
//  QTY ENTRIES
//  define this virtual function in derived class
//----------------------------------------------------------------------------------------------------------------------
int	cSettings :: qty_entries ()
{
	return sizeof ( aTable ) / sizeof ( sEntry );
}

//----------------------------------------------------------------------------------------------------------------------
//  TABLE
//  define this virtual function in derived class
//----------------------------------------------------------------------------------------------------------------------
cSettings::sEntry * cSettings :: table ( int i )
{ 
   return &aTable[i];
}

//----------------------------------------------------------------------------------------------------------------------
//  INIT
//----------------------------------------------------------------------------------------------------------------------
void cSettings :: init ()
{
	sSignature							= L"CamTool";
	Version								= g_Version;
	bOn							        = true;
	uBrightness 						= 50;
	uContrast 						    = 50;
	uGamma						        = 100;
	bExpanded                           = true;
	ptMainWindowPosition                = cPtI ( -1, -1 );
}

